<?php
	header('Content-Type:text/html;charset=utf-8');
	$conn = mysqli_connect('127.0.0.1','root','','zxcfusers',3306);
	//$conn = mysqli_connect(SAE_MYSQL_HOST_M, SAE_MYSQL_USER, SAE_MYSQL_PASS,  SAE_MYSQL_DB, SAE_MYSQL_PORT);
	$sql = "SET NAMES UTF8";
	mysqli_query($conn,$sql);

	$uname=$_REQUEST['uname'];
	$upwd=$_REQUEST['upwd'];
	$uphone=$_REQUEST['uphone'];
	$inviteCode=$_REQUEST['inviteCode'];

	$sql = "SELECT * FROM users WHERE uname='$uname' OR uname='$uphone' OR uphone='$uphone'";
	$result = mysqli_query($conn, $sql);

	$row=mysqli_fetch_assoc($result);
	if($row===null){
		$sql2 = "INSERT INTO users VALUES(NULL,'$uname','$upwd','$uphone','$inviteCode')";
		$result2 = mysqli_query($conn, $sql2);

		if($result2){
			echo "yes";
		}
	}else{
		echo "eroor";
	}
